//- Copyright (c) 2016 Lucky Byte, Inc.
extends ../../table

append scripts
  script(src="/js/upay/acoma.js")

block form_items
  .field.two.wide
    .ui.calendar.date#start_date(data-maxdate="#{today()}")
      .ui.input.left.icon.small.compact
        i.calendar.icon
        input(type="text" name="settl_date" placeholder="清算日期"
          value="#{settl_date || ''}")

  .field.eleven.wide
    .ui.buttons.right.floated.small.compact
      button.ui.green.button.labeled.icon(type="submit") 查 询
        i.icon.search

block thead
  tr
    th.center.aligned 序 号
    th.center.aligned 交易时间
    th.center.aligned 消息类型
    th.center.aligned 处理码
    th.center.aligned 主账号
    th.center.aligned 交易金额
    th.center.aligned 承兑金额
    th.center.aligned 手续费
    th.center.aligned 商户编号
    th.center.aligned 终端编号
    th.center.aligned 清算日期
    th.center.aligned 场次
    th.center.aligned 跟踪号
    th.center.aligned 检索参考号
    th.center.aligned 冲正
    th.center.aligned 撤销

block tbody
  each record, index in records
    - var tr_class = ''
    - var chnl_icon_color = 'green'

    tr(class="#{tr_class}")
      td.center.aligned.collapsing
        i.icon.caret.right.link.detail.expand
        = record.serial
      td.center.aligned.collapsing= fmttime10(record.trans_time)
      td.center.aligned.collapsing= record.msg_type
      td.center.aligned.collapsing= record.proc_code
      td.center.aligned.collapsing= record.pri_acct
      td.center.aligned.collapsing= fmtamt2(record.trans_amt)
      td.center.aligned.collapsing= fmtamt2(record.acpt_amt)
      td.center.aligned.collapsing= record.fee ? fmtamt(record.fee) : '-'
      td.center.aligned.collapsing= record.acpt_id
      td.center.aligned.collapsing= record.term_id
      td.center.aligned.collapsing= record.settl_date
      td.center.aligned.collapsing= record.settl_cnt
      td.center.aligned.collapsing= record.trace_num
      td.center.aligned.collapsing= record.retref_num
      td.center.aligned.collapsing= record.reverse
      td.center.aligned.collapsing= record.revoke

    tr.detail(style="display: none;")
      td.right.aligned.warning(colspan="1") 详细信息
      td(colspan="16"
        style="padding-top:0px; padding-bottom:0px; padding-right:1px;")
        include detail
  else
    td.center.aligned.warning(colspan="17") 无数据
